from base.base_actions import BaseAction
from element.index_element import IndexElement

class IndexPage(BaseAction):
    # 点击 首页链接
    def click_index_btn(self):
        return self.click(IndexElement.INDEX_LINK_BTN)

    # 点击登录按钮
    def click_login_btn(self):
        return self.click(IndexElement.LOGIN_LINK_BTN)

    # 搜索输入框输入关键字
    def input_search(self, keywords):
        return self.input(IndexElement.SEARCH_INPUT, keywords)

    # 点击搜索按钮
    def click_search(self):
        return self.click(IndexElement.SEARCH_BTN)

    # 点击 我的订单 链接
    def click_my_order_link(self):
        return self.click(IndexElement.MY_ORDER_LINK)

    # 点击 我的购物车 链接
    def click_my_cart_link(self):
        return self.click(IndexElement.MY_CART_LINK)